/*
 *  stringAddition.h
 *  smsAssistant
 *
 *  Created by sffofn on 11-6-1.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */
//#import "sys/utsname.h"

#import "RegexKitLite.h"

@interface NSString(Addition)

- (BOOL)isPhoneFormat;
- (BOOL)isEmailFormat;

@end

@implementation NSString(Addition)


//是否为手机号
- (BOOL)isPhoneFormat
{
    return [self isMatchedByRegex:@"\\b([1][3-9][0-9]{9})\\b"];
}

//是否是邮箱地址
- (BOOL)isEmailFormat
{
    return [self isMatchedByRegex:@"\\b([a-zA-Z0-9%_.+\\-]+)@([a-zA-Z0-9.\\-]+?\\.[a-zA-Z]{2,6})\\b"];
}






@end
